<?php
App::uses('AppModel', 'Model');
/**
 * AccountsExpense Model
 *
 * @property Account $Account
 * @property Situation $Situation
 * @property Expense $Expense
 */
class AccountsExpense extends AppModel {


    public function beforeSave($options = array()){
        if(!empty($this->data['AccountsExpense']['value'])){
            $this->data['AccountsExpense']['value'] = str_replace(',','.',$this->data['AccountsExpense']['value']);
        }
    }


	//The Associations below have been created with all possible keys, those that are not needed can be removed

/**
 * belongsTo associations
 *
 * @var array
 */
	public $belongsTo = array(
		'Account' => array(
			'className' => 'Account',
			'foreignKey' => 'account_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Situation' => array(
			'className' => 'Situation',
			'foreignKey' => 'situation_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Expense' => array(
			'className' => 'Expense',
			'foreignKey' => 'expense_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
}
